package com.app.dao.admin;

import com.app.SpringAnnotationDef;
import com.app.dao.BaseDaoImpl;
import com.app.model.ORG_Resources;
import com.app.model.User;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: cnprinces
 * Date: 13-1-19
 * Time: 上午9:46
 * To change this template use File | Settings | File Templates.
 */

@Scope(SpringAnnotationDef.SCOPE_PROTOTYPE)
@Repository(SpringAnnotationDef.ADMIN_DAO)
public class AdminDaoImpl extends BaseDaoImpl<ORG_Resources, Integer> implements AdminDao {

    public AdminDaoImpl() {
        super(ORG_Resources.class);
    }

    @Override
    public List<ORG_Resources> getParentRes() {
        String hql = "from ORG_Resources where parentId=0";


        Query query = getSession().createQuery(hql);

        return query.list();
    }
}
